/*****************************************************************************
 *
 * Copyright (c), 2004-2020,ShangHai Neotune Information Technology Co., Ltd.
 *
 * Module Name : sha.h
 *
 * Author :    sean
 *
 * Date :    2004-02-05
 *
 * Version :    1.00
 *
 * Description :    
 *
 * Other :    
 *
 * Data Structure List: <Main Data Structure>
 *
 * Modification History
 * ---------------------------------------------------------------------------
 *  1: Data :      2004-02-05
 *    Author :     sean
 *    Version :    V100R001M00
 *    Modification : creation
 *
*****************************************************************************/

#ifndef EPILOGUE_SHA_H
#define EPILOGUE_SHA_H

#ifdef __cplusplus
extern"C" {
#endif

/* get the installation options */
#ifndef EPILOGUE_INSTALL_H
#include <install.h>
#endif /* EPILOGUE_INSTALL_H */

/* get the Epilogue types */
#ifndef EPILOGUE_TYPES_H
#include <snmptypes.h>
#endif  /* EPILOGUE_TYPES_H */

#define SHA_BLOCKSIZE           64
#define SHA_DIGESTSIZE          20

typedef struct {
    bits32_t count_lo, count_hi;  /* 64-bit bit count */
    bits32_t buf[5];              /* scratch buffer */
    bits8_t  data[SHA_BLOCKSIZE]; /* SHA data (input) buffer */
    bits8_t  digest[20];          /* message digest after sha_final call */
    size_t   local;               /* unprocessed amount in data */
} SHA_CTX;

void sha_init   __((SHA_CTX *));
void sha_update __((SHA_CTX *, bits8_t *, bits32_t));
void sha_final  __((SHA_CTX *));

#ifdef __cplusplus
}
#endif

#endif /* EPILOGUE_SHA_H */

